package com.itheima.demo;

import com.itheima.domain.Orders;
import com.itheima.domain.User;
import com.itheima.mapperTest.mapperDemo;

import java.util.List;

public class Demo {

    public static void main(String[] args) throws Exception {
        mapperDemo m = new mapperDemo();

        List<User> list = m.Mapper().findAll();
        for (User user : list) {
            System.out.println("用户名:"+ user.getUsername());
            List<Orders>  orders = user.getOrdersList();
            for (Orders o : orders) {
                System.out.println("订单编号:"+o.getNumber());
            }
        }
        m.close();
    }
}
